Real-time endoscopic optical diagnosis